# -*-coding:utf-8-*-
from alg_model.XGBoost import XGBoost_R
from alg_model.LSTM import LSTM_R
import pandas as pd
from pandas.core.frame import DataFrame
def testXGB(dateList,dataList):
    # 构造数据列表 每10个数据预测1个
    batch = len(dataList)//10
    x = []
    y = []
    pointer = 0
    while (pointer+batch+1)<=len(dataList):
        x.append(dataList[pointer:pointer+batch])
        y.append(dataList[pointer+batch])
        pointer += 1
    # 将列表转化为数据框
    x = DataFrame(x)
    y = DataFrame({"y":y})
    # 预测30期
    return XGBoost_R.run(x,y,dateList,dataList,predictNum=len(dataList)//10,batch=batch)
    # return LSTM_R.run(x,y,dateList,dataList,predictNum=len(dataList)//10,batch=batch)